<!DOCTYPE>
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="__PUBLIC__/Home/css/user_center.css">
    <script src="__PUBLIC__/Admin/js/jquery-1.9.1.js"></script>
    <script src="__PUBLIC__/Common/Layer/layer.js"></script>
    <title>会员中心</title>
</head>

<body>

<style>
    .layui-layer{
        top:150px !important;
    }
</style>
<!-- 栏目 -->
<include file="Public:header_center" />

<!-- 内容 -->
<div style="background-color:#f5f5f5;">
    <div class="content" style="width:1200px;">

        <include file="Public:left_center" />

        <div class="center-right right">
            <h3 class="title">我的订单</h3>
            <div class="Options" style=" width:1050px; background-color:#FFF; padding:20px;">
                <ul id="tabs">
                    <li><a href="{:U('User/my_order_lst')}" title="tab1">全部订单</a></li>
                    <li><a href="{:U('User/payment_for_lst')}" title="tab2">待付款</a></li>
                    <li><a href="{:U('User/receipt_of_goods')}" title="tab3">待收货</a></li>
                    <li><a href="{:U('User/payments_waite')}" title="tab4">待评价</a></li>
					 <li><a href="{:U('User/order_end')}" title="tab5">待完成</a></li>
                    <div class="search1"><input type="text" value=""><img src="__PUBLIC__/Home/img/search2.jpg" width="23" height="23"></div>

                </ul>
                <div id="content">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="size12">
                        <tr>
                            <td width="30%" height="34" align="center" bgcolor="#f5f5f5">近三个月订单</td>
                            <td width="30%" height="34" align="center" bgcolor="#f5f5f5">订单详情 </td>
                            <td width="10%" height="34" align="center" bgcolor="#f5f5f5">收货人</td>
                            <td width="10%" height="34" align="center" bgcolor="#f5f5f5">金额</td>
                            <td width="10%" height="34" align="center" bgcolor="#f5f5f5">全部状态</td>
                            <td width="10%" height="34" align="center" bgcolor="#f5f5f5">操作</td>
                        </tr>
                    </table>


                    <foreach name="res" item="vo">
                        <div id="tab3" class="tab{$vo.id}">
                            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#e4e4e4" style="margin:20px 0; line-height:24px;" class="size12">
                                <tr>
                                    <td colspan="5" bgcolor="#f5f5f5" class="text-indent"> <span class="gray">&#12288订单号：</span>{$vo.orders_num}</td>
                                </tr>
                                <tr>
                                    <td width="60%" height="13" bgcolor="#FFFFFF">
                                        <foreach name="vo.result" item="res_vo">
                                        <span class="Odd-number">
										<a href="{:U('Index/goods_details')}?id={$res_vo.goods_id}">
                                            <img src="__PUBLIC__/Uploads/goods/{$res_vo.pic_url}" width="60" height="60">
                                            <b class="name1">{$res_vo.goods_title}</b>
										</a>
                                            <b class="Quantity">x{$res_vo.goods_num}</b>
                                        </span>
                                        </foreach>
                                    </td>
                                    <td width="10%" rowspan="2" align="center" valign="top" bgcolor="#FFFFFF" style="padding-top:10px;"><span class="name">{$vo.realname}</span></td>
                                    <td width="10%" rowspan="2" align="center" valign="top" bgcolor="#FFFFFF" style="padding-top:10px;">
                                        <p class="gray">总额￥{$vo.price_sum}</p>
                                        <p class="bold">应付</p>
                                        <p class="bold">￥{$vo.price_shiji}</p>
                                    </td>
                                    <td width="10%" rowspan="2" align="center" valign="top" bgcolor="#FFFFFF" style="padding-top:10px;">
                                        <if condition="$vo['pay_status'] eq 0">
                                            <p class="red">等待付款</p>
                                            <else />
                                            <p class="track">跟踪</p>
                                        </if>


                                        <!--<p><a href="javascript:void (0);">订单详情</a></p>-->
                                    </td>
                                    <td width="10%" rowspan="2" align="center" valign="top" bgcolor="#FFFFFF" style="padding-top:10px;">
                                        <if condition="$vo['pay_status'] eq 0">
                                            <p><a href="{:U('Cart/make_pay_button')}?orders_num={$vo.orders_num}" class="payment">付款</a></p>
                                            <p><a href="javascript:void (0);" onclick="cancel_order({$vo.id})">取消订单</a></p>
                                            <else />
                                            <p><a href="javascript:void (0);" class="payment">已付款</a></p>
                                        </if>


                                    </td>
                                </tr>
                                <tr>
                                    <td height="14" bgcolor="#FFFFFF"><span style="display: inline-block; width: 110px; text-align: center">收货地址：</span>{$vo.user_address}</td>
                                </tr>
                            </table>
                        </div>
                    </foreach>
                    <div style="text-align: center">
                        {$page}
                    </div>
                </div>
            </div>

        </div>
    </div>
    <!-- 底部 -->
    <include file="Public:footer_center" />
</body>

<script>
    //取消订单
    function cancel_order(id){
        $.post("{:U('User/cancel_order')}", { "id": id},
                function(data){
                    if(data==1){
                        layer.msg('删除成功', {
                            time: 2000 //2秒关闭（如果不配置，默认是3秒）
                        }, function(){
                            $('.tab'+id).remove();
                        });
                    }else{
                        layer.msg('删除失败');
                    }
                }, "json");
    }
</script>
</html>
